package com.erp.erp_servers.money.imp;

import com.erp.erp_dao.money.IReceivePaymentDetailDao;
import com.erp.erp_entitys.money.entity.ReceivePaymentDetailEntity;
import com.erp.erp_servers.money.IReceivePaymentDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : ReceivePaymentDetailImp
 * @Description : 资金管理-收款明细实现类
 * @Author : lst
 * @Date: 2020-12-04 15:04
 */
@Service
public class ReceivePaymentDetailImp implements IReceivePaymentDetailService {

    /**
     * 注入收款明细mapper
     */
    private final IReceivePaymentDetailDao receivePaymentDetailDao;

    @Autowired
    public ReceivePaymentDetailImp(IReceivePaymentDetailDao receivePaymentDetailDao) {
        this.receivePaymentDetailDao = receivePaymentDetailDao;
    }


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ReceivePaymentDetailEntity queryById(Integer id) {
        return receivePaymentDetailDao.queryById(id);
    }


    /**
     * 根据主表id集合查询明细
     * @param ids 主表id集合
     * @return 明细
     */
    @Override
    public List<ReceivePaymentDetailEntity> queryByParentIds(List<Integer> ids) {
        return receivePaymentDetailDao.queryByParentIds(ids);
    }


    /**
     * 通过实体作为筛选条件查询
     *
     * @param receivePaymentDetail 实例对象
     * @return 对象列表
     */
    @Override
    public List<ReceivePaymentDetailEntity> queryAll(ReceivePaymentDetailEntity receivePaymentDetail) {
        return receivePaymentDetailDao.queryAll(receivePaymentDetail);
    }


    /**
     * 新增数据
     *
     * @param receivePaymentDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(ReceivePaymentDetailEntity receivePaymentDetail) {
        return receivePaymentDetailDao.insert(receivePaymentDetail);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<ReceivePaymentDetailEntity> list) {
        return receivePaymentDetailDao.addList(list);
    }


    /**
     * 修改数据
     *
     * @param receivePaymentDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int update(ReceivePaymentDetailEntity receivePaymentDetail) {
        return receivePaymentDetailDao.update(receivePaymentDetail);
    }
}
